package com.cnb.telepathytalk.dto;

import java.io.Serializable;

public class RoomInfoDTO implements InterfaceDTO, Serializable {
	private static final long serialVersionUID = 4776224561952482187L;

	private int index;
	private int type;
	private String createTime;
	private String searchWord;
	private int chatingAbleTime;
	private int alarm;
	private Integer[] userIndexs;
	private Integer[] messageIndexs;

	public RoomInfoDTO(int index, int type, String createTime, String searchWord, int chatingAbleTime, int alarm, Integer[] userIndexs,
			Integer[] messageIndexs) {
		super();
		this.index = index;
		this.type = type;
		this.createTime = createTime;
		this.searchWord = searchWord;
		this.chatingAbleTime = chatingAbleTime;
		this.alarm = alarm;
		this.userIndexs = userIndexs;
		this.messageIndexs = messageIndexs;
	}

	public boolean getAlarm() {
		return alarm == 1 ? true : false;
	}

	public int getIndex() {
		return index;
	}

	public void setIndex(int index) {
		this.index = index;
	}

	public int getType() {
		return type;
	}

	public void setType(int type) {
		this.type = type;
	}

	public String getCreateTime() {
		if (createTime == null)
			return "";
		return createTime;
	}

	public void setCreateTime(String createTime) {
		this.createTime = createTime;
	}

	public String getSearchWord() {
		if (searchWord == null)
			return "";
		return searchWord;
	}

	public void setSearchWord(String searchWord) {
		this.searchWord = searchWord;
	}

	public int getChatingAbleTime() {
		return chatingAbleTime;
	}

	public void setChatingAbleTime(int chatingAbleTime) {
		this.chatingAbleTime = chatingAbleTime;
	}

	public Integer[] getUsers() {
		if (userIndexs == null) {
			return new Integer[0];
		}
		return userIndexs;
	}

	public void setUsers(Integer[] userIndexs) {
		this.userIndexs = userIndexs;
	}

	public Integer[] getMessages() {
		if (messageIndexs == null) {
			return new Integer[0];
		}
		return messageIndexs;
	}

	public void setMessages(Integer[] messageIndexs) {
		this.messageIndexs = messageIndexs;
	}
}
